package com.dkd.manage.controller;

import com.dkd.common.annotation.Anonymous;
import com.dkd.common.core.controller.BaseController;
import com.dkd.manage.domain.Device;
import com.dkd.manage.service.IDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author QZ09
 * @since 2025-05-16 星期五 11:20:07
 */
@Anonymous
@RestController
@RequestMapping("/manage/device")
public class DeviceController extends BaseController {
    @Autowired
    private IDeviceService deviceService;
    @GetMapping("getDeviceList")
    public List<Device> getDeviceList() {
        try {
            return deviceService.getDevicelist();
        }catch (Exception e){
            System.err.println("获取列表失败"+e.getMessage());
            e.printStackTrace();
            return new ArrayList<>();
        }
    }
}
